package com.zhiyou100.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zhiyou100.entity.prosGo.TbUser;





/**
 * 作者：王宇航
 * 作用：跳转页面
 * 
 * @author 10172
 *
 *
 */

@Controller
public class PageController {


	
	@RequestMapping("{path}.do")
	public String page(@PathVariable String path , HttpServletRequest request) {
		if (path!=null&&path.contains("gyzc-list")) {
			return "forward:selectGyzc.do?go=1";
		}
		if (path!=null&&path.contains("new_product")) {
			TbUser user =(TbUser)request.getSession().getAttribute("tbUser2");
			System.out.println(user);
			if (user==null||user.getUsId()==null) {
				return "forward:login.do";
			}
			if (user==null||user.getUsIdcard()==null) {
				return "forward:login.do";
			}
		}
		return path;
	}
}
